<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/views/common/taglibs.jsp"%>
<%@ page import="org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter" %>
<%@ page import="org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter" %>
<%@ page import="org.springframework.security.core.AuthenticationException" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><spring:message code="aplicacion.titulo"/></title>
        <%@ include file="/WEB-INF/views/common/staticResourcesLogin.jsp"%>
    </head>
    
    <body class="yui-skin-sam" onload="document.getElementById('userInputText').focus();">
        <div id="layout-top">
            <div class="container">
                <div class="header">
                    <div id="logo-app"></div>
                    
                    <div id="titulo-pagina">
                        <spring:message code="header.titulo" />
                    </div>
                    
                    <div class="menu">
                    </div>
                </div>
            </div>
        </div>
                    
        <div id="layout-center">
            <div id="layout-center-top">
                <div class="content">
                    
                    <form name="f" action="<c:url value='/j_spring_security_check'/>" method="POST">
                        <table class="loginTable" align="center" >
                            <tr>
                                <td colspan="2">
                                     <c:if test="${not empty param.login_error}">
                                        <span style="color: red;">
                                            <spring:message code="autenticacion.fallo" /><br/>
                                            <spring:message code="autenticacion.razon" />:&nbsp;<c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}"/>.
                                        </span>
                                    </c:if>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <spring:message code="login.usuario" />
                                </td>
                                <td>
                                    <input id="userInputText" type='text' name='j_username' value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>'/>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <spring:message code="login.contrasena" />
                                </td>
                                <td>
                                    <input type='password' name='j_password'>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" colspan="2">
                                    <input id="ingresar" name="ingresar" type="submit" class="iesubmit" value="<spring:message code='login.ingresar' />">
                                </td>
                            </tr>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>